<template>
  <div>
    <my-table :tableObj="tableObj" :selection="true" v-loading="loading">
      <template #default>
        <el-table-column label="操作" width="120px">
          <template #default>
            <el-button type="primary" link>编辑</el-button>
            <el-button type="danger" link>删除</el-button>
          </template>
        </el-table-column>
      </template>
    </my-table>
  </div>
</template>

<script lang="ts" setup>
import MyTable from "@/components/table/MyTable.vue";
import type { TableHeader, TableObj } from "@/components/table/types";

const loading = ref(false);

const tableHeader: TableHeader = [
  {
    label: "用户名称",
    value: "empName",
  },
  {
    label: "邮箱号",
    value: "mailNum",
  },
  {
    label: "工号",
    value: "empNum",
  },
  {
    label: "角色",
    value: "roleNameList",
  },
  {
    label: "操作人",
    value: "updater",
  },
  {
    label: "操作时间",
    value: "updateTime",
  },
];
const tableObj = computed<TableObj>(() => {
  return {
    tableData: [
      {
        empName: "string",
        mailNum: "string",
        empNum: "string",
        roleNameList: "string",
        updater: "string",
        updateTime: "string",
      },
      {
        empName: "string2",
        mailNum: "string2",
        empNum: "string2",
        roleNameList: "string2",
        updater: "string2",
        updateTime: "string2",
      },
    ],
    tableHeader,
  };
});
</script>
